%% Making and using a class to calculate primes

% We created the class definition for 'CalcPrimes' See 'CalcPrimes.m'


%If we make changes to the class definition we need to clear variables and
%class defintions like this:
clear FP
clear classes

%Note: We can see our own help text like this:
help CalcPrimes

% Create object from from class 'CalcPrimes'
FP=CalcPrimes()

%Test the method that checks to see if a number is prime. 
FP.CheckPrime(5)

%Call the method that will find all prime numbers up to FP.Nmax
FP.FindPrimes()

%We can change Nmax from the default and time how long it takes
FP.Nmax=10000
tic
FP.FindPrimes()
toc







